/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import {apiPrefixDispose} from '@/utils/format';
import {request} from '@umijs/max';


/**
 * 查询角色
 */
export async function rolePage<T = any>(body: API.RolePage) {
  return request<API.ResultPageVO<API.RoleVO>>(apiPrefixDispose('/role/select'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}


/**
 * 新增角色
 */
export async function addRole<T = any>(body: API.RoleAdd) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/role/add'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}





/**
 * 查询角色集(只有正常的角色)
 */
export async function roles<T = any>() {
  return request<API.ResultVO<API.RoleVO[]>>(apiPrefixDispose('/role/roles'), {
    method: 'GET',
  });
}


/**
 * 删除角色
 */
export async function deleteByCodes<T = any>(
  codes: Array<string>,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/role/delete'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: codes,
    ...(options || {}),
  });
}


/**
 * 启用角色
 */
export async function enabled<T = any>(
  codes: Array<string>,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/role/enabled'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: codes,
    ...(options || {}),
  });
}

/**
 * 禁用角色
 */
export async function disable<T = any>(
  codes: Array<string>,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/role/disable'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: codes,
    ...(options || {}),
  });
}
